;Assembler header file for CompressJPEG
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:11:42 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 24 May 1995

        [       :LNOT: :DEF: CompressJPEG_Hdr
        GBLS    CompressJPEG_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_JPEG
        GBLS    Get_JPEG
        ]
        [       :LNOT: :DEF: JPEG_Hdr
Get_JPEG                        SETS    "GET oslib/JPEG.Hdr"
        |
Get_JPEG                        SETS    ""
        ]
        $Get_JPEG

;Symbols for constants
CompressJPEG_ControlTerminated  *       &1
CompressJPEG_SourceType         *       &7
CompressJPEG_SourceType1BPP     *       &0
CompressJPEG_SourceType2BPP     *       &1
CompressJPEG_SourceType4BPP     *       &2
CompressJPEG_SourceType8BPP     *       &3
CompressJPEG_SourceType16BPP    *       &4
CompressJPEG_SourceType32BPP    *       &5
CompressJPEG_SourceTypeRGBTriples *       &7
CompressJPEG_HasDoubleEntries   *       &8
CompressJPEG_IgnoreHighByte     *       &10
CompressJPEG_IsRGB              *       &20
CompressJPEG_GenerateProgressive *       &1
CompressJPEG_OperationOnUnknowns *       &6
CompressJPEG_OperationOnUnknownsShift *       1
CompressJPEG_TransformationType *       &78
CompressJPEG_TransformationTypeShift *       3
CompressJPEG_TrimEdges          *       &80
CompressJPEG_GenerateGreyscale  *       &100
CompressJPEG_OptimiseForSmaller *       &200
CompressJPEG_CopyNoAdditional   *       &0
CompressJPEG_CopyComments       *       &1
CompressJPEG_CopyAllElements    *       &3
CompressJPEG_NoTransformation   *       &0
CompressJPEG_FlipHorizontally   *       &1
CompressJPEG_FlipVertically     *       &2
CompressJPEG_Rotate90Clockwise  *       &3
CompressJPEG_Rotate180          *       &4
CompressJPEG_Rotate90AntiClockwise *       &5
CompressJPEG_Transpose          *       &6
CompressJPEG_TransverseTranspose *       &7
Error_CompressJPEGBadBPP        *       &8183C0
Error_CompressJPEGBadLineCount  *       &8183C1
Error_CompressJPEGBadBuffer     *       &8183C2
Error_CompressJPEGBadSize       *       &8183C3
Error_CompressJPEGArithNotImpl  *       &81A881
Error_CompressJPEGBadAlignType  *       &81A882
Error_CompressJPEGBadAllocChunk *       &81A883
Error_CompressJPEGBadBufferMode *       &81A884
Error_CompressJPEGBadComponentID *       &81A885
Error_CompressJPEGBadDctSize    *       &81A886
Error_CompressJPEGBadInColourSpace *       &81A887
Error_CompressJPEGBadKColourSpace *       &81A888
Error_CompressJPEGBadLength     *       &81A889
Error_CompressJPEGBadMCUSize    *       &81A88A
Error_CompressJPEGBadPoolID     *       &81A88B
Error_CompressJPEGBadPrecision  *       &81A88C
Error_CompressJPEGBadSampling   *       &81A88D
Error_CompressJPEGBadState      *       &81A88E
Error_CompressJPEGBadVirtualAccess *       &81A88F
Error_CompressJPEGBufferSize    *       &81A890
Error_CompressJPEGCantSuspend   *       &81A891
Error_CompressJPEGCCIR601NotImpl *       &81A892
Error_CompressJPEGComponentCount *       &81A893
Error_CompressJPEGConversionNotImpl *       &81A894
Error_CompressJPEGDACIndex      *       &81A895
Error_CompressJPEGDACValue      *       &81A896
Error_CompressJPEGDHTIndex      *       &81A897
Error_CompressJPEGDQTIndex      *       &81A898
Error_CompressJPEGEmptyImage    *       &81A899
Error_CompressJPEGEOIExpected   *       &81A89A
Error_CompressJPEGFileRead      *       &81A89B
Error_CompressJPEGFileWrite     *       &81A89C
Error_CompressJPEGFractSampleNotImpl *       &81A89D
Error_CompressJPEGHuffCLenOverflow *       &81A89E
Error_CompressJPEGHuffMissingCode *       &81A89F
Error_CompressJPEGImageTooBig   *       &81A8A0
Error_CompressJPEGInputEmpty    *       &81A8A1
Error_CompressJPEGInputEOF      *       &81A8A2
Error_CompressJPEGNotImpl       *       &81A8A3
Error_CompressJPEGNotCompiled   *       &81A8A4
Error_CompressJPEGNoBackingStore *       &81A8A5
Error_CompressJPEGNoHuffTable   *       &81A8A6
Error_CompressJPEGNoImage       *       &81A8A7
Error_CompressJPEGNoQuantTable  *       &81A8A8
Error_CompressJPEGNoSOI         *       &81A8A9
Error_CompressJPEGOutOfMemory   *       &81A8AA
Error_CompressJPEGQuantComponents *       &81A8AB
Error_CompressJPEGQuantFewColours *       &81A8AC
Error_CompressJPEGQuantManyColours *       &81A8AD
Error_CompressJPEGSOFDuplicate  *       &81A8AE
Error_CompressJPEGSOFNoSOS      *       &81A8AF
Error_CompressJPEGSOFUnsupported *       &81A8B0
Error_CompressJPEGSOIDuplicate  *       &81A8B1
Error_CompressJPEGSOSNoSOF      *       &81A8B2
Error_CompressJPEGTooLittleData *       &81A8B3
Error_CompressJPEGUnknownMarker *       &81A8B4
Error_CompressJPEGVirtualBug    *       &81A8B5
Error_CompressJPEGWidthOverflow *       &81A8B6
Error_CompressJPEGBadDCTCoef    *       &81A8B7
Error_CompressJPEGBadHuffTable  *       &81A8B8
Error_CompressJPEGBadProgression *       &81A8B9
Error_CompressJPEGBadProgScript *       &81A8BA
Error_CompressJPEGBadScanScript *       &81A8BB
Error_CompressJPEGMismatchedQuantTable *       &81A8BC
Error_CompressJPEGMissingData   *       &81A8BD
Error_CompressJPEGModeChange    *       &81A8BE
Error_CompressJPEGWBufferSize   *       &81A8BF

;Symbols for structure offsets and sizes
CompressJPEG_Tag                *       4 ;abstract type
                                ^       0
CompressJPEG_Parameters_width   #       Int
CompressJPEG_Parameters_height  #       Int
CompressJPEG_Parameters_quality #       Int
CompressJPEG_Parameters_bytes_per_pixel #       Int
CompressJPEG_Parameters_xdpi    #       Int
CompressJPEG_Parameters_ydpi    #       Int
CompressJPEG_Parameters         *       @

                                ^       0
CompressJPEG_ScanDescription_scan_count #       Int
CompressJPEG_ScanDescription_scan_data_components #       Int
CompressJPEG_ScanDescription_scan_data_r #       Int
CompressJPEG_ScanDescription_scan_data_g #       Int
CompressJPEG_ScanDescription_scan_data_b #       Int
CompressJPEG_ScanDescription_scan_data_ss #       Int
CompressJPEG_ScanDescription_scan_data_se #       Int
CompressJPEG_ScanDescription_scan_data_ah #       Int
CompressJPEG_ScanDescription_scan_data_al #       Int
CompressJPEG_ScanDescription    *       @
        
        MACRO
$label                          CompressJPEG_ScanDescription_MEMBERS
$label._scan_count              #       Int
        MEND
        
                                ^       0
CompressJPEG_ScanDescriptionBase CompressJPEG_ScanDescription_MEMBERS
CompressJPEG_ScanDescriptionBase *       @

                                ^       0
                                #       Bits
CompressJPEG_CommentFlags       *       @

                                ^       0
                                #       Bits
CompressJPEG_WriteLineFlags     *       @

                                ^       0
                                #       Bits
CompressJPEG_TranscodeFlags     *       @


;Symbols for SWI's and SWI reason codes
XCompressJPEG_Start             *       &6A500
CompressJPEG_Start              *       &4A500
   ;Entry
   ;  R0 -> image (JPEG_Image)
   ;  R1 = image_size (Int)
   ;  R2 -> parameters (CompressJPEG_Parameters)
   ;  R3 = workspace (pointer to Void)
   ;  R4 = workspace_size (Int)
   ;Exit
   ;  R0 = tag (CompressJPEG_Tag)

XCompressJPEG_WriteLine         *       &6A501
CompressJPEG_WriteLine          *       &4A501
   ;Entry
   ;  R0 = tag (CompressJPEG_Tag)
   ;  R1 -> pixels (data)

XCompressJPEG_Finish            *       &6A502
CompressJPEG_Finish             *       &4A502
   ;Entry
   ;  R0 = tag (CompressJPEG_Tag)
   ;Exit
   ;  R0 = image_size (Int)

XCompressJPEG_Comment           *       &6A503
CompressJPEG_Comment            *       &4A503
   ;Entry
   ;  R0 = tag (CompressJPEG_Tag)
   ;  R1 = flags (CompressJPEG_CommentFlags)
   ;  R2 -> comment (Char)
   ;  R3 = comment_size (Int)

XCompressJPEG_WriteLineExtended *       &6A504
CompressJPEG_WriteLineExtended  *       &4A504
   ;Entry
   ;  R0 = tag (CompressJPEG_Tag)
   ;  R1 = flags (CompressJPEG_WriteLineFlags)
   ;  R2 -> image_data (data)
   ;  R3 -> palette_data (data)
   ;  R4 = lines (Int)
   ;  R5 = bytes_between_lines (Int)
   ;Exit
   ;  R2 -> image_data_end (data)
   ;  R4 = lines_written (Int)

XCompressJPEG_Transcode         *       &6A510
CompressJPEG_Transcode          *       &4A510
   ;Entry
   ;  R0 = flags (CompressJPEG_TranscodeFlags)
   ;  R1 -> source_data (data)
   ;  R2 = source_size (Int)
   ;  R3 = destination_data (pointer to data)
   ;  R4 = destination_size (Int)
   ;  R5 = workspace (pointer to data)
   ;  R6 = workspace_size (Int)
   ;  R7 -> scans (CompressJPEG_ScanDescription)

        ]
        END
